home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / MiamiSDK / netinclude / ppcpragmas / miami_pragmas.h next >
C/C++ Source or Header  |  1997-12-30  |  12KB  |  454 lines

  1. #ifndef _PPCPRAGMA_MIAMI_H
  2. #define _PPCPRAGMA_MIAMI_H
  3.  
  4. #ifndef POWERUP_PPCLIB_INTERFACE_H
  5. #include <powerup/ppclib/interface.h>
  6. #endif
  7.  
  8. #ifndef POWERUP_GCCLIB_PROTOS_H
  9. #include <powerup/gcclib/powerup_protos.h>
  10. #endif
  11.  
  12. #ifndef _STRING_H
  13. #include <string.h>
  14. #endif
  15.  
  16. #ifndef NO_PPCINLINE_STDARG
  17. #define NO_PPCINLINE_STDARG
  18. #endif/* SAS C PPC inlines */
  19.  
  20. #ifndef MIAMI_BASE_NAME
  21. #define MIAMI_BASE_NAME MiamiBase
  22. #endif
  23.  
  24. #define MiamiSysCtl(n,nl,o,ol,new,newl) _MiamiSysCtl(MIAMI_BASE_NAME,n,nl,o,ol,new,newl)
  25.  
  26. static __inline long
  27. _MiamiSysCtl(void *MiamiBase,long *n,unsigned long nl,void *o,unsigned long *ol,
  28.  void *new,unsigned long newl) {
  29.     struct Caos MyCaos;
  30.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  31.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  32.     MyCaos.a0=(ULONG)n;
  33.     MyCaos.d0=(ULONG)nl;
  34.     MyCaos.a1=(ULONG)o;
  35.     MyCaos.a2=(ULONG)ol;
  36.     MyCaos.a3=(ULONG)new;
  37.     MyCaos.d1=(ULONG)newl;
  38.     MyCaos.caos_Un.Offset=-30;
  39.     MyCaos.a6=(ULONG)MiamiBase;
  40.     return (long)PPCCallOS(&MyCaos);
  41. }
  42.  
  43. #define MiamiDisallowDNS(v) _MiamiDisallowDNS(MIAMI_BASE_NAME,v)
  44.  
  45. static __inline void
  46. _MiamiDisallowDNS(void *MiamiBase,long v) {
  47.     struct Caos MyCaos;
  48.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  49.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  50.     MyCaos.d0=(ULONG)v;
  51.     MyCaos.caos_Un.Offset=-66;
  52.     MyCaos.a6=(ULONG)MiamiBase;
  53.     PPCCallOS(&MyCaos);
  54. }
  55.  
  56. #define MiamiGetPid() _MiamiGetPid(MIAMI_BASE_NAME)
  57.  
  58. static __inline void *
  59. _MiamiGetPid(void *MiamiBase) {
  60.     struct Caos MyCaos;
  61.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  62.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  63.     MyCaos.caos_Un.Offset=-78;
  64.     MyCaos.a6=(ULONG)MiamiBase;
  65.     return (void *)PPCCallOS(&MyCaos);
  66. }
  67.  
  68. #define MiamiPFAddHook(hook,name,tags) _MiamiPFAddHook(MIAMI_BASE_NAME,hook,name,tags)
  69.  
  70. static __inline void *
  71. _MiamiPFAddHook(void *MiamiBase,struct Hook *hook,unsigned char *name,
  72.  struct TagItem *tags) {
  73.     struct Caos MyCaos;
  74.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  75.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  76.     MyCaos.a0=(ULONG)hook;
  77.     MyCaos.a1=(ULONG)name;
  78.     MyCaos.a2=(ULONG)tags;
  79.     MyCaos.caos_Un.Offset=-96;
  80.     MyCaos.a6=(ULONG)MiamiBase;
  81.     return (void *)PPCCallOS(&MyCaos);
  82. }
  83.  
  84. #define MiamiPFRemoveHook(handle) _MiamiPFRemoveHook(MIAMI_BASE_NAME,handle)
  85.  
  86. static __inline void
  87. _MiamiPFRemoveHook(void *MiamiBase,void *handle) {
  88.     struct Caos MyCaos;
  89.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  90.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  91.     MyCaos.a0=(ULONG)handle;
  92.     MyCaos.caos_Un.Offset=-102;
  93.     MyCaos.a6=(ULONG)MiamiBase;
  94.     PPCCallOS(&MyCaos);
  95. }
  96.  
  97. #define MiamiGetHardwareLen(name) _MiamiGetHardwareLen(MIAMI_BASE_NAME,name)
  98.  
  99. static __inline long
  100. _MiamiGetHardwareLen(void *MiamiBase,unsigned char *name) {
  101.     struct Caos MyCaos;
  102.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  103.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  104.     MyCaos.a0=(ULONG)name;
  105.     MyCaos.caos_Un.Offset=-108;
  106.     MyCaos.a6=(ULONG)MiamiBase;
  107.     return (long)PPCCallOS(&MyCaos);
  108. }
  109.  
  110. #define MiamiOpenSSL(tags) _MiamiOpenSSL(MIAMI_BASE_NAME,tags)
  111.  
  112. static __inline struct Library *
  113. _MiamiOpenSSL(void *MiamiBase,struct TagItem *tags) {
  114.     struct Caos MyCaos;
  115.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  116.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  117.     MyCaos.a0=(ULONG)tags;
  118.     MyCaos.caos_Un.Offset=-150;
  119.     MyCaos.a6=(ULONG)MiamiBase;
  120.     return (struct Library *)PPCCallOS(&MyCaos);
  121. }
  122.  
  123. #define MiamiCloseSSL() _MiamiCloseSSL(MIAMI_BASE_NAME)
  124.  
  125. static __inline void
  126. _MiamiCloseSSL(void *MiamiBase) {
  127.     struct Caos MyCaos;
  128.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  129.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  130.     MyCaos.caos_Un.Offset=-156;
  131.     MyCaos.a6=(ULONG)MiamiBase;
  132.     PPCCallOS(&MyCaos);
  133. }
  134.  
  135. #define MiamiSetSocksConn(in,len) _MiamiSetSocksConn(MIAMI_BASE_NAME,in,len)
  136.  
  137. static __inline long
  138. _MiamiSetSocksConn(void *MiamiBase,struct sockaddr *in,long len) {
  139.     struct Caos MyCaos;
  140.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  141.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  142.     MyCaos.a0=(ULONG)in;
  143.     MyCaos.d0=(ULONG)len;
  144.     MyCaos.caos_Un.Offset=-198;
  145.     MyCaos.a6=(ULONG)MiamiBase;
  146.     return (long)PPCCallOS(&MyCaos);
  147. }
  148.  
  149. #define MiamiIsOnline(name) _MiamiIsOnline(MIAMI_BASE_NAME,name)
  150.  
  151. static __inline long
  152. _MiamiIsOnline(void *MiamiBase,char *name) {
  153.     struct Caos MyCaos;
  154.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  155.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  156.     MyCaos.a0=(ULONG)name;
  157.     MyCaos.caos_Un.Offset=-210;
  158.     MyCaos.a6=(ULONG)MiamiBase;
  159.     return (long)PPCCallOS(&MyCaos);
  160. }
  161.  
  162. #define MiamiOnOffline(name,val) _MiamiOnOffline(MIAMI_BASE_NAME,name,val)
  163.  
  164. static __inline void
  165. _MiamiOnOffline(void *MiamiBase,char *name,long val) {
  166.     struct Caos MyCaos;
  167.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  168.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  169.     MyCaos.a0=(ULONG)name;
  170.     MyCaos.d0=(ULONG)val;
  171.     MyCaos.caos_Un.Offset=-216;
  172.     MyCaos.a6=(ULONG)MiamiBase;
  173.     PPCCallOS(&MyCaos);
  174. }
  175.  
  176. #define inet_ntop(f,a,s,l) _inet_ntop(MIAMI_BASE_NAME,f,a,s,l)
  177.  
  178. static __inline char *
  179. _inet_ntop(void *MiamiBase,long f,void *a,char *s,long l) {
  180.     struct Caos MyCaos;
  181.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  182.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  183.     MyCaos.d0=(ULONG)f;
  184.     MyCaos.a0=(ULONG)a;
  185.     MyCaos.a1=(ULONG)s;
  186.     MyCaos.d1=(ULONG)l;
  187.     MyCaos.caos_Un.Offset=-228;
  188.     MyCaos.a6=(ULONG)MiamiBase;
  189.     return (char *)PPCCallOS(&MyCaos);
  190. }
  191.  
  192. #define inet_aton(c,a) _inet_aton(MIAMI_BASE_NAME,c,a)
  193.  
  194. static __inline long
  195. _inet_aton(void *MiamiBase,char *c,struct in_addr *a) {
  196.     struct Caos MyCaos;
  197.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  198.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  199.     MyCaos.a0=(ULONG)c;
  200.     MyCaos.a1=(ULONG)a;
  201.     MyCaos.caos_Un.Offset=-234;
  202.     MyCaos.a6=(ULONG)MiamiBase;
  203.     return (long)PPCCallOS(&MyCaos);
  204. }
  205.  
  206. #define inet_pton(f,s,a) _inet_pton(MIAMI_BASE_NAME,f,s,a)
  207.  
  208. static __inline long
  209. _inet_pton(void *MiamiBase,long f,char *s,struct in_addr *a) {
  210.     struct Caos MyCaos;
  211.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  212.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  213.     MyCaos.d0=(ULONG)f;
  214.     MyCaos.a0=(ULONG)s;
  215.     MyCaos.a1=(ULONG)a;
  216.     MyCaos.caos_Un.Offset=-240;
  217.     MyCaos.a6=(ULONG)MiamiBase;
  218.     return (long)PPCCallOS(&MyCaos);
  219. }
  220.  
  221. #define gethostbyname2(n,f) _gethostbyname2(MIAMI_BASE_NAME,n,f)
  222.  
  223. static __inline struct hostent *
  224. _gethostbyname2(void *MiamiBase,char *n,long f) {
  225.     struct Caos MyCaos;
  226.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  227.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  228.     MyCaos.a0=(ULONG)n;
  229.     MyCaos.d0=(ULONG)f;
  230.     MyCaos.caos_Un.Offset=-246;
  231.     MyCaos.a6=(ULONG)MiamiBase;
  232.     return (struct hostent *)PPCCallOS(&MyCaos);
  233. }
  234.  
  235. #define gai_strerror(e) _gai_strerror(MIAMI_BASE_NAME,e)
  236.  
  237. static __inline char *
  238. _gai_strerror(void *MiamiBase,long e) {
  239.     struct Caos MyCaos;
  240.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  241.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  242.     MyCaos.d0=(ULONG)e;
  243.     MyCaos.caos_Un.Offset=-252;
  244.     MyCaos.a6=(ULONG)MiamiBase;
  245.     return (char *)PPCCallOS(&MyCaos);
  246. }
  247.  
  248. #define freeaddrinfo(a) _freeaddrinfo(MIAMI_BASE_NAME,a)
  249.  
  250. static __inline void
  251. _freeaddrinfo(void *MiamiBase,struct addrinfo *a) {
  252.     struct Caos MyCaos;
  253.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  254.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  255.     MyCaos.a0=(ULONG)a;
  256.     MyCaos.caos_Un.Offset=-258;
  257.     MyCaos.a6=(ULONG)MiamiBase;
  258.     PPCCallOS(&MyCaos);
  259. }
  260.  
  261. #define getaddrinfo(h,s,hi,r) _getaddrinfo(MIAMI_BASE_NAME,h,s,hi,r)
  262.  
  263. static __inline long
  264. _getaddrinfo(void *MiamiBase,char *h,char *s,struct addrinfo *hi,struct addrinfo **r) {
  265.     struct Caos MyCaos;
  266.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  267.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  268.     MyCaos.a0=(ULONG)h;
  269.     MyCaos.a1=(ULONG)s;
  270.     MyCaos.a2=(ULONG)hi;
  271.     MyCaos.a3=(ULONG)r;
  272.     MyCaos.caos_Un.Offset=-264;
  273.     MyCaos.a6=(ULONG)MiamiBase;
  274.     return (long)PPCCallOS(&MyCaos);
  275. }
  276.  
  277. #define getnameinfo(s,sl,h,hl,se,sel,f) _getnameinfo(MIAMI_BASE_NAME,s,sl,h,hl,se,sel,f)
  278.  
  279. static __inline long
  280. _getnameinfo(void *MiamiBase,struct sockaddr *s,long sl,char *h,long hl,
  281.  char *se,long sel,long f) {
  282.     struct Caos MyCaos;
  283.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  284.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  285.     MyCaos.a0=(ULONG)s;
  286.     MyCaos.d0=(ULONG)sl;
  287.     MyCaos.a1=(ULONG)h;
  288.     MyCaos.d1=(ULONG)hl;
  289.     MyCaos.a2=(ULONG)se;
  290.     MyCaos.d2=(ULONG)sel;
  291.     MyCaos.d3=(ULONG)f;
  292.     MyCaos.caos_Un.Offset=-270;
  293.     MyCaos.a6=(ULONG)MiamiBase;
  294.     return (long)PPCCallOS(&MyCaos);
  295. }
  296.  
  297. #define if_nametoindex(in) _if_nametoindex(MIAMI_BASE_NAME,in)
  298.  
  299. static __inline long
  300. _if_nametoindex(void *MiamiBase,char *in) {
  301.     struct Caos MyCaos;
  302.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  303.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  304.     MyCaos.a0=(ULONG)in;
  305.     MyCaos.caos_Un.Offset=-276;
  306.     MyCaos.a6=(ULONG)MiamiBase;
  307.     return (long)PPCCallOS(&MyCaos);
  308. }
  309.  
  310. #define if_indextoname(in,n) _if_indextoname(MIAMI_BASE_NAME,in,n)
  311.  
  312. static __inline char *
  313. _if_indextoname(void *MiamiBase,long in,char *n) {
  314.     struct Caos MyCaos;
  315.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  316.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  317.     MyCaos.d0=(ULONG)in;
  318.     MyCaos.a0=(ULONG)n;
  319.     MyCaos.caos_Un.Offset=-282;
  320.     MyCaos.a6=(ULONG)MiamiBase;
  321.     return (char *)PPCCallOS(&MyCaos);
  322. }
  323.  
  324. #define if_nameindex() _if_nameindex(MIAMI_BASE_NAME)
  325.  
  326. static __inline struct if_nameindex *
  327. _if_nameindex(void *MiamiBase) {
  328.     struct Caos MyCaos;
  329.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  330.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  331.     MyCaos.caos_Un.Offset=-288;
  332.     MyCaos.a6=(ULONG)MiamiBase;
  333.     return (struct if_nameindex *)PPCCallOS(&MyCaos);
  334. }
  335.  
  336. #define if_freenameindex(p) _if_freenameindex(MIAMI_BASE_NAME,p)
  337.  
  338. static __inline void
  339. _if_freenameindex(void *MiamiBase,struct if_nameindex *p) {
  340.     struct Caos MyCaos;
  341.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  342.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  343.     MyCaos.a0=(ULONG)p;
  344.     MyCaos.caos_Un.Offset=-294;
  345.     MyCaos.a6=(ULONG)MiamiBase;
  346.     PPCCallOS(&MyCaos);
  347. }
  348.  
  349. #define MiamiSupportsIPV6() _MiamiSupportsIPV6(MIAMI_BASE_NAME)
  350.  
  351. static __inline long
  352. _MiamiSupportsIPV6(void *MiamiBase) {
  353.     struct Caos MyCaos;
  354.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  355.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  356.     MyCaos.caos_Un.Offset=-300;
  357.     MyCaos.a6=(ULONG)MiamiBase;
  358.     return (long)PPCCallOS(&MyCaos);
  359. }
  360.  
  361. #define MiamiResGetOptions() _MiamiResGetOptions(MIAMI_BASE_NAME)
  362.  
  363. static __inline long
  364. _MiamiResGetOptions(void *MiamiBase) {
  365.     struct Caos MyCaos;
  366.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  367.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  368.     MyCaos.caos_Un.Offset=-306;
  369.     MyCaos.a6=(ULONG)MiamiBase;
  370.     return (long)PPCCallOS(&MyCaos);
  371. }
  372.  
  373. #define MiamiResSetOptions(o) _MiamiResSetOptions(MIAMI_BASE_NAME,o)
  374.  
  375. static __inline void
  376. _MiamiResSetOptions(void *MiamiBase,long o) {
  377.     struct Caos MyCaos;
  378.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  379.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  380.     MyCaos.d0=(ULONG)o;
  381.     MyCaos.caos_Un.Offset=-312;
  382.     MyCaos.a6=(ULONG)MiamiBase;
  383.     PPCCallOS(&MyCaos);
  384. }
  385.  
  386. #define sockatmark(fd) _sockatmark(MIAMI_BASE_NAME,fd)
  387.  
  388. static __inline long
  389. _sockatmark(void *MiamiBase,long fd) {
  390.     struct Caos MyCaos;
  391.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  392.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  393.     MyCaos.d0=(ULONG)fd;
  394.     MyCaos.caos_Un.Offset=-318;
  395.     MyCaos.a6=(ULONG)MiamiBase;
  396.     return (long)PPCCallOS(&MyCaos);
  397. }
  398.  
  399. #define MiamiSupportedCPUs(a,c,k) _MiamiSupportedCPUs(MIAMI_BASE_NAME,a,c,k)
  400.  
  401. static __inline void
  402. _MiamiSupportedCPUs(void *MiamiBase,ULONG *a,ULONG *c,ULONG *k) {
  403.     struct Caos MyCaos;
  404.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  405.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  406.     MyCaos.a0=(ULONG)a;
  407.     MyCaos.a1=(ULONG)c;
  408.     MyCaos.a2=(ULONG)k;
  409.     MyCaos.caos_Un.Offset=-324;
  410.     MyCaos.a6=(ULONG)MiamiBase;
  411.     PPCCallOS(&MyCaos);
  412. }
  413.  
  414. #define MiamiGetFdCallback(c) _MiamiGetFdCallback(MIAMI_BASE_NAME,c)
  415.  
  416. static __inline long
  417. _MiamiGetFdCallback(void *MiamiBase,void **c) {
  418.     struct Caos MyCaos;
  419.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  420.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  421.     MyCaos.a0=(ULONG)c;
  422.     MyCaos.caos_Un.Offset=-330;
  423.     MyCaos.a6=(ULONG)MiamiBase;
  424.     return (long)PPCCallOS(&MyCaos);
  425. }
  426.  
  427. #define MiamiSetFdCallback(c,t) _MiamiSetFdCallback(MIAMI_BASE_NAME,c,t)
  428.  
  429. static __inline long
  430. _MiamiSetFdCallback(void *MiamiBase,void *c,long t) {
  431.     struct Caos MyCaos;
  432.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  433.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  434.     MyCaos.a0=(ULONG)c;
  435.     MyCaos.d0=(ULONG)t;
  436.     MyCaos.caos_Un.Offset=-336;
  437.     MyCaos.a6=(ULONG)MiamiBase;
  438.     return (long)PPCCallOS(&MyCaos);
  439. }
  440.  
  441. #define MiamiGetCredentials() _MiamiGetCredentials(MIAMI_BASE_NAME)
  442.  
  443. static __inline struct UserGroupCredentials *
  444. _MiamiGetCredentials(void *MiamiBase) {
  445.     struct Caos MyCaos;
  446.     MyCaos.M68kCacheMode=IF_CACHEFLUSHALL;
  447.     MyCaos.PPCCacheMode=IF_CACHEFLUSHALL;
  448.     MyCaos.caos_Un.Offset=-348;
  449.     MyCaos.a6=(ULONG)MiamiBase;
  450.     return (struct UserGroupCredentials *)PPCCallOS(&MyCaos);
  451. }
  452.  
  453. #endif
  454.